package com.geekaca.d06;

import java.util.HashMap;
import java.util.Map;

public class TestMap {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("T001", "张无忌");
        map.put("T002", "周芷若");
        map.put("T003", "tom");

        String t001V = map.get("T001");
        System.out.println(t001V);
        map.put(null, null);
        map.put("T001", "张三丰");
        System.out.println(map.get("T001"));

        //取一个不存在的key
        System.out.println(map.get("T999"));
        System.out.println(map);
        System.out.println("======================================");

        String t001 = map.remove("T001");
        System.out.println(t001);
        System.out.println("删除后");
        System.out.println(map);

        System.out.println(map.containsKey("T002"));
        System.out.println(map.containsValue("张三丰"));

        System.out.println(map.isEmpty());
        System.out.println(map.size());

        map.clear();
        System.out.println(map);
    }

}
